<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<!DOCTYPE html>
<html lang="en">
<head>
<title><s:message code="app.title" /></title>
<%@ include file="Include.jsp"%>
<script type="text/javascript">
	
	$(document).ready(function() {
		$("#fullname").focus();
		
		$('#editContact').click(function(){
			$('#contactForm').attr('action','EditContact');
			$('#contactForm').attr('method','post');
			$('#contactForm').submit();
		});
	});
	
</script>
</head>
<body>
	<div class="container">
		<%@ include file="Menu.jsp"%>
		<h2><s:message code="contactForm.editheader" /></h2>
		<hr>
		<form:form id="cancelForm">			
		</form:form>
		<form:form class="form-horizontal" method="post" name="contactForm" id="contactForm" commandName="contactForm"
	           modelAttribute="contactForm" >
			<form:hidden path="contactid" cssClass="input-medium" id="contactid" />
			
			<table class="table table-bordered">
				<tr>
					<th><form:label path="categoryid" id="categoryLabel"><s:message code="contactForm.categoryid" /></form:label></th>
					<td colspan="3">
						<form:select path="categoryid" cssClass="input-large" tabindex="7">
							<form:option value="">- Select -</form:option>
							<form:options items="${categoryList}" itemLabel="formvalue" itemValue="codetableid" />
						</form:select>
 					<form:errors cssClass="text-error" path="categoryid" />
					</td>
				</tr>
				<tr>
					<th width="15%"><form:label path="fullname"><s:message code="contactForm.fullname" /></form:label></th>
					<td ><form:input path="fullname" cssClass="input-medium" id="fullname" maxlength="50" size="60" tabindex="1" />
					<form:errors cssClass="text-error" path="fullname" /></td>
					<th ><form:label path="shortname"><s:message code="contactForm.shortname" /></form:label></th>
					<td ><form:input path="shortname" cssClass="input-medium" id="shortname" maxlength="50" size="60" tabindex="1" />
					<form:errors cssClass="text-error" path="shortname" />
					</td>
				</tr>
				<tr>
					<th><form:label path="creditterms"><s:message code="contactForm.creditterms" /></form:label></th>
					<td><form:input path="creditterms" cssClass="input-medium" id="creditterms" maxlength="3" size="11" />
					<form:errors cssClass="text-error" path="creditterms" /></td>
					<th><form:label path="area" id="arealabel"><s:message code="contactForm.area" /></form:label></th>
					<td>
						<form:input path="area" cssClass="input-medium" id="area" maxlength="50" size="25" />
 						<form:errors cssClass="text-error" path="area" />
					</td>
				</tr>
				<tr>
					<th><form:label path="industryid" id="industryidLabel"><s:message code="contactForm.industry" /></form:label></th>
					<td colspan="3">
						<form:select path="industryid" cssClass="input-large" tabindex="7">
							<form:option value="">- Select -</form:option>
							<form:option value="1">Industry 1</form:option>
							<form:option value="2">Industry 2</form:option>
						</form:select>
 					<form:errors cssClass="text-error" path="industryid" />
					</td>
				</tr>
				<tr>
					<th><form:label path="seniourdesk" id="seniourdesklabel"><s:message code="contactForm.seniourdesk" /></form:label></th>
					<td>
						<form:input path="seniourdesk" cssClass="input-medium" id="seniourdesk" maxlength="20" size="20" />
 						<form:errors cssClass="text-error" path="seniourdesk" />
					</td>
					<th><form:label path="manager" id="managerlabel"><s:message code="contactForm.manager" /></form:label></th>
					<td>
						<form:input path="manager" cssClass="input-medium" id="manager" maxlength="20" size="20" />
 						<form:errors cssClass="text-error" path="manager" />
					</td>
				</tr>
				<tr>
					<th><form:label path="scellno" id="scellnolabel"><s:message code="contactForm.scellno" /></form:label></th>
					<td>
						<form:input path="scellno" cssClass="input-medium" id="scellno" maxlength="12" size="12" />
- 						<form:errors cssClass="text-error" path="scellno" />
					</td>
					<th><form:label path="mcellno" id="mcellnolable"><s:message code="contactForm.mcellno" /></form:label></th>
					<td>
						<form:input path="mcellno" cssClass="input-medium" id="mcellno" maxlength="12" size="12" />
 						<form:errors cssClass="text-error" path="mcellno" />
					</td>
				</tr>
				<tr>
					<th><form:label path="semail" id="semaillabel"><s:message code="contactForm.semail" /></form:label></th>
					<td>
						<form:input path="semail" cssClass="input-medium" id="semail" maxlength="20" size="20" />
 						<form:errors cssClass="text-error" path="semail" />
					</td>
					<th><form:label path="memail" id="memaillable"><s:message code="contactForm.memail" /></form:label></th>
					<td>
						<form:input path="memail" cssClass="input-medium" id="memail" maxlength="20" size="20" />
 						<form:errors cssClass="text-error" path="memail" />
					</td>
				</tr>
				<tr>
					<th><form:label path="website" id="websitelable"><s:message code="contactForm.website" /></form:label></th>
					<td>
						<form:input path="website" cssClass="input-medium" id="website" maxlength="20" size="20" />
 						<form:errors cssClass="text-error" path="website" />
					</td>
					<th><form:label path="address" id="addresslable"><s:message code="contactForm.address" /></form:label></th>
					<td>
						<form:input path="address" cssClass="input-medium" id="address" maxlength="20" size="20" />
 						<form:errors cssClass="text-error" path="address" />
					</td>
				</tr>
				<tr>
					<th><form:label path="pancardno" id="addresslable"><s:message code="contactForm.pancardno" /></form:label></th>
					<td>
						<form:input path="pancardno" cssClass="input-medium" id="pancardno" maxlength="20" size="20" />
 						<form:errors cssClass="text-error" path="pancardno" />
					</td>
					<th><form:label path="ieccode" id="addresslable"><s:message code="contactForm.ieccode" /></form:label></th>
					<td>
						<form:input path="ieccode" cssClass="input-medium" id="ieccode" maxlength="20" size="20" />
 						<form:errors cssClass="text-error" path="ieccode" />
					</td>
				</tr>				
				<tr>
					<th><form:label path="comments"><s:message code="contactForm.comments" /></form:label></th>
					<td colspan="3">
						<form:textarea path="comments" rows="4" id="comments" cssClass="input-xlarge" />
						<form:errors cssClass="text-error" path="comments" />
					</td>
				</tr>
		</table>
		<br>
			<button class="btn btn-primary" type="button" id="editContact" ><s:message code="add.edit" /></button>
			<button class="btn btn-primary" type="submit" id="cancelContact" formaction="ListContact" formmethod="get" form="cancelForm"><s:message code="app.cancel" /></button>
		</form:form>
		 <%@ include file="Footer.jsp"%>
	</div>
</body>
</html>